package com.sbw.wx.controller;

import com.alibaba.fastjson.JSONObject;
import com.sbw.wx.config.BaseInfoConfig;
import com.sbw.wx.entity.AccessTokenBean;
import com.sbw.wx.path.RequestPathConst;
import com.sbw.wx.utils.AccessTokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import sun.plugin2.message.Message;

import java.text.MessageFormat;
import java.util.concurrent.TimeUnit;

/**
 * Desc: 微信交互基础控制器
 * @Date: 2021/6/27 6:59
 * @Author: Lee
 * 面朝大海  春暖花开
 * */
@Slf4j
@RestController
@RequestMapping("/base")
public class BaseController {

    @Autowired
    private AccessTokenUtil accessTokenUtil;

    /**
     * Desc: 获取AccessToken, AccessToken有效期两小时
     * @Date: 2021/6/27 8:21
     * @Author: Lee
     * 面朝大海  春暖花开
     * */
    @GetMapping("/getAccessToken")
    public String getAccessToken(){
        return accessTokenUtil.getAccessToken();
    }

}
